home *** CD-ROM | disk | FTP | other *** search
/ Diccionario Visual Trilingue / VISUAL.iso / SHARED.DIR / 10030_Quit and Credit Code.ls < prev    next >
Encoding:
Text File  |  1997-07-04  |  5.4 KB  |  198 lines

  1. global gInterfaceLanguage, gScreenStatus, gReturnDialog, gHighLightPos, gFlushDialogEvent, gFreeSprite, gTransitionType, gTransitionSize, gEditeur
  2.  
  3. on ShowQuit
  4.   global gPrgKey
  5.   if gPrgKey = 2 then
  6.     set gPrgKey to gPrgKey + 1
  7.   else
  8.     set gPrgKey to -10
  9.   end if
  10.   set TempList to []
  11.   repeat with n = 1 to 48
  12.     add(TempList, the cursor of sprite n)
  13.     set the cursor of sprite n to 4
  14.   end repeat
  15.   watchCursor()
  16.   ResetNavigPopUp()
  17.   if (gScreenStatus = #ILLUSTRATION) or (gScreenStatus = #REGION) or (gScreenStatus = #ZOOM) then
  18.     FlushAllAnimationsData()
  19.     ResetActiveLabels()
  20.     ResetScreenLists()
  21.     EraseAll()
  22.   end if
  23.   set gReturnDialog to gScreenStatus
  24.   GrabStage()
  25.   addRAMobjects(#CastList, [10567, 10570, 10571])
  26.   set the text of field 10567 to getString(#QUITLINE1, gInterfaceLanguage)
  27.   set the text of field 10574 to getString(#QUITLINE2, gInterfaceLanguage)
  28.   set the text of field 10571 to getString(#CANCEL, gInterfaceLanguage)
  29.   set the text of cast 10570 to getString(#ok, gInterfaceLanguage)
  30.   set locvsprite5 to 48
  31.   set largeursprite8 to 180
  32.   if gInterfaceLanguage = 1 then
  33.     set lochsprite5 to 36
  34.     set lochsprite8 to 150
  35.   else
  36.     if gInterfaceLanguage = 2 then
  37.       set lochsprite5 to 51
  38.       set lochsprite8 to 134
  39.     else
  40.       if gInterfaceLanguage = 3 then
  41.         set lochsprite5 to 64
  42.         set lochsprite8 to 144
  43.       end if
  44.     end if
  45.   end if
  46.   repeat with i = 1 to 46
  47.     set the visible of sprite i to 1
  48.   end repeat
  49.   set the visible of sprite 5 to 0
  50.   set the visible of sprite 8 to 0
  51.   set the visible of sprite 30 to 0
  52.   puppetTransition(9, 0, 5)
  53.   gotoframe(10)
  54.   set X1 to the locH of sprite 2 - getAt(the regPoint of cast 10529, 1)
  55.   set Y1 to the locV of sprite 2 - getAt(the regPoint of cast 10529, 2)
  56.   set the locH of sprite 5 to X1 + lochsprite5
  57.   set the locV of sprite 5 to Y1 + locvsprite5
  58.   set the locH of sprite 8 to X1 + lochsprite8
  59.   set the locV of sprite 8 to the locV of sprite 5 + 13
  60.   set the width of sprite 8 to largeursprite8
  61.   set the visible of sprite 5 to 1
  62.   set the visible of sprite 8 to 1
  63.   set gScreenStatus to #quit
  64.   puppetTransition(0)
  65.   updateStage()
  66.   repeat with n = 1 to 48
  67.     set the cursor of sprite n to getAt(TempList, n)
  68.   end repeat
  69.   cursor(-1)
  70.   set the cursor of sprite 2 to 0
  71.   set the cursor of sprite 5 to 0
  72.   set the cursor of sprite 8 to 0
  73.   SpriteHandCursor(3)
  74.   SpriteHandCursor(4)
  75.   SpriteHandCursor(6)
  76.   SpriteHandCursor(7)
  77.   SpriteHandCursor(30)
  78.   SpriteHandCursor(31)
  79. end
  80.  
  81. on CancelQuit
  82.   watchCursor()
  83.   GrabStage(0)
  84.   set gFreeSprite to 48
  85.   ReCreateScreen(gReturnDialog, 1)
  86.   ClearCursor()
  87. end
  88.  
  89. on KeyDownQuit
  90.   if the machineType = 256 then
  91.     if the visible of sprite 30 = 1 then
  92.       set BoutonOn to 1
  93.     else
  94.       set BoutonOn to 0
  95.     end if
  96.     if the keyCode = 48 then
  97.       if BoutonOn = 0 then
  98.         ActiveButton(1)
  99.       else
  100.         ActiveButton(2)
  101.       end if
  102.     end if
  103.     if (the key = RETURN) or (the key = ENTER) then
  104.       if gReturnDialog = #HISTORY then
  105.         set gFlushDialogEvent to 1
  106.       end if
  107.       if BoutonOn = 0 then
  108.         flashButton(3)
  109.         QuitMovie()
  110.       else
  111.         flashButton(4)
  112.         CancelQuit()
  113.       end if
  114.       dontPassEvent()
  115.       abort()
  116.     end if
  117.   else
  118.     if (the key = RETURN) or (the key = ENTER) then
  119.       flashButton(3)
  120.       QuitMovie()
  121.     end if
  122.     if the commandDown and (the key = ".") then
  123.       flashButton(4)
  124.       CancelQuit()
  125.     end if
  126.   end if
  127.   dontPassEvent()
  128.   abort()
  129. end
  130.  
  131. on ShowCredit
  132.   global gPrgKey
  133.   watchCursor()
  134.   if gPrgKey = 3 then
  135.     set gPrgKey to gPrgKey + 1
  136.   else
  137.     set gPrgKey to -10
  138.   end if
  139.   set gReturnDialog to gScreenStatus
  140.   set gScreenStatus to #CREDIT
  141.   FlushAllAnimationsData()
  142.   if (gScreenStatus = #ILLUSTRATION) or (gScreenStatus = #ZOOM) or (gScreenStatus = #REGION) then
  143.     ResetActiveLabels()
  144.     ResetScreenLists()
  145.   end if
  146.   GrabStage(0)
  147.   gotoframe(25, 0)
  148.   set FirstCreditScrn to 10583
  149.   addRAMobjects(#CastList, [10582, FirstCreditScrn])
  150.   set the castNum of sprite 1 to 10582
  151.   set the locH of sprite 1 to 320
  152.   set the locV of sprite 1 to 240
  153.   set the castNum of sprite 2 to FirstCreditScrn
  154.   set the ink of sprite 2 to 36
  155.   setCreditPosition()
  156.   puppetTransition(gTransitionType, 0, gTransitionSize)
  157.   updateStage()
  158.   puppetTransition(0)
  159.   handCursor()
  160. end
  161.  
  162. on CreditEvent
  163.   if the castType of cast (the castNum of sprite 2 + 1) <> #empty then
  164.     set TempNum to the castNum of sprite 2 + 1
  165.     addRAMobjects(#CastList, [TempNum])
  166.     set the castNum of sprite 2 to TempNum
  167.     setCreditPosition()
  168.     if the castType of cast (TempNum + 1) = #empty then
  169.       set the ink of sprite 2 to 0
  170.     end if
  171.     puppetTransition(gTransitionType, 0, gTransitionSize)
  172.     updateStage()
  173.     puppetTransition(0)
  174.   else
  175.     watchCursor()
  176.     GrabStage(0)
  177.     set gFreeSprite to 48
  178.     ReCreateScreen(gReturnDialog)
  179.     ClearCursor()
  180.   end if
  181. end
  182.  
  183. on CloseCredit
  184.   watchCursor()
  185.   GrabStage(0)
  186.   set gFreeSprite to 48
  187.   ReCreateScreen(gReturnDialog)
  188.   ClearCursor()
  189. end
  190.  
  191. on setCreditPosition
  192.   set theCastName to the name of cast the castNum of sprite 2
  193.   set posTemp to value(chars(theCastName, offset("(", theCastName) + 1, offset(",", theCastName) - 1))
  194.   set the locH of sprite 2 to posTemp + (the width of cast the castNum of sprite 2 / 2)
  195.   set posTemp to value(chars(theCastName, offset(",", theCastName) + 1, offset(")", theCastName) - 1))
  196.   set the locV of sprite 2 to posTemp + (the height of cast the castNum of sprite 2 / 2)
  197. end
  198.